source("C:\\PRYWATNE\\Dropbox\\MOW_projekt\\srcMarcin\\MOW\\src\\algorithms\\forest.r")library(randomForest)

library(randomForest)

spam <- read.csv('data/spambase.data.txt', head=FALSE, sep = ",", dec=".")

head(spam)
spam["class"] <-NA
spam$class = spam$V58
#spam[ncol(spam)] <-NULL

colnames(spam)
head(spam)

fdata = factor(spam$class)
spam$class  <- fdata


test = spam[ c(1601:1900),1:(ncol(spam)-2) ]
train = spam[ c(1:300, 4200:4500),1:(ncol(spam)-2) ]



colnames(train)=names(spam[c(1601:1900),1:(ncol(spam)-2)])
colnames(test)=names(spam[c(1601:1900),1:(ncol(spam)-2)])

trainSet<- data.frame(train)
testSet<- data.frame(test)

r = randomForest(class ~., data=train, importance=TRUE, do.trace=100)	

print(r)